/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package me.yobol.lintcode;

/**
 *
 * @author Yobol
 */
public class LinkedListUtils {
    public static void print(ListNode root){
        ListNode current = root;
        while(current != null){
            System.out.print(current.val);
            current = current.next;
            if (current != null) {
                System.out.print(" -> ");
            }
        }
        System.out.println("");
    }
}
